Compose: expose painterResource in Xamarin.AndroidX.Compose.UI.Android#1449
Closed
Copilot wants to merge 3 commits into
Closed
Compose: expose painterResource in Xamarin.AndroidX.Compose.UI.Android#1449Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix painterResource not bound in Xamarin.AndroidX.Compose.UI.Android
Compose: expose painterResource in Xamarin.AndroidX.Compose.UI.Android
Jun 5, 2026
Member
|
@copilot this PR does nothing?!? |
… painterResource + toolchain-surfaced API) Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Contributor
Author
You're right that the earlier diff was effectively a no-op. I dug in and verified the actual situation:
What I changed:
One thing worth a decision: rebuilding with the current toolchain also surfaces ~96 inline-class mangled methods (e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shipped
Xamarin.AndroidX.Compose.UI.Android1.11.2 assembly does not containpainterResource, sopainterResource(@DrawableRes Int): Painterwas unreachable from C# — leaving the boundPainter/BitmapPainter/ColorPaintertypes unusable in typical Compose code.The current binder toolchain already projects this method automatically; the checked-in binding predates that. No metadata transform is needed (an
add-nodefor it would produce a duplicate method, CS0111). The fix is to record the regenerated API and ship a new package revision.Changes
PublicAPI/PublicAPI.Unshipped.txt: regenerated from a real local build ofui-androidrather than hand-edited. This file is auto-generated at build time (Directory.Build.targets→_GeneratePublicApiFiles), so a manual single-line edit had no effect. The regenerated file is a strict superset (+403 lines, 0 removals) and includesPainterResources_androidKt.PainterResource(int, IComposer?, int) -> Painter.config.json: bumpXamarin.AndroidX.Compose.UI.Android1.11.2→1.11.2.1to trigger a rebuild that ships the bound method.The bound method projects as:
Notes
AndroidX.Compose.UI.Resalready exists inpublished-namespaces.txt; no namespace-file change required.painterResource, while a clean local build with the current toolchain emits it automatically (noBG8605drop).ui-unit-android/ui-graphics-android. They can be stripped via metadata instead if preferred.